package kgc.qy.controller;

import kgc.qy.pojo.Department;
import kgc.qy.pojo.SysUsers;
import kgc.qy.service.IRoleService;
import kgc.qy.util.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RequestMapping(value = "role")
@RestController
public class RoleController {

    @Autowired
    private IRoleService roleService;

    @PostMapping(value = "role")
    public CommonResult showRole(){
        List<Department> departments = roleService.selectDep();
        return new CommonResult(200,"查询成功",departments);
    }


}
